1. Field of the Invention
The present invention relates to a graphics plotting apparatus for plotting three-dimensional computer graphics with smooth-shading and texture-mapping, and particularly, to a graphics plotting apparatus and a graphics plotting method capable of easily plotting a perspective image in which things far away are seen smaller.
2. Description of the Prior Art
A three-dimensional graphics plotting apparatus changes the coordinates of a three-dimensional image to those of a two-dimensional image and prepares data of the vertexes of the two-dimensional image. The apparatus calculates the luminance and depth of each pixel contained in a polygon defined by the vertexes, and writes the luminance and depth to an image memory at locations corresponding to the pixels.
FIGS. 1(A) to 1(D) show processes of changing the coordinates of a three-dimensional image to those of a two-dimensional triangle, preparing data of the vertexes of the triangle, and mapping the vertex data in an image memory. In FIG. 1(A), the transformed two-dimensional triangle 5-0 has vertexes 5-1, 5-2, and 5-3. In FIG. 1(B), the luminance, depth, and two-dimensional position of each edge point of the triangle 5-0 are calculated and interpolated. In FIG. 1(C), the edge points are linearly interpolated along horizontal scan lines, and the luminance and depth of each pixel contained in the triangle 5-0 are calculated. In FIG. 1(D), the luminance and depth of each pixel are written to the image memory at locations corresponding to the pixels.
When an image on a three-dimensional coordinate system is perspectively projected to a surface, deep parts of the image become smaller. When the projected image is linearly interpolated, the luminance and depth of each pixel thus obtained differ from those obtained by interpolating the original three-dimensional image. The difference is particularly conspicuous when texture mapping is carried out to plot a two-dimensional image according to a three-dimensional image. It is difficult to plot a perspective polygon by linear interpolation. When carrying out texture mapping to form a perspective image, it is necessary to inversely change each pixel or a small number of pixels from a projection surface to a three-dimensional coordinate system. Alternatively, it is necessary to divide a polygon on a three-dimensional coordinate system into small polygons so that a projected image may not be influenced by perspective. These measures, however, require an enormous amount of divisional calculations, and therefore, are improper for real-time animations. When carrying out smooth shading with a DDA (digital differential analyzer), the conventional plotting apparatus must preprocess difference values. This involves a large number of calculations.